package cn.iocoder.yudao.module.call.dal.mysql.ivrknowledgeissue;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.call.dal.dataobject.ivrknowledgeissue.IvrKnowledgeIssueDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.call.controller.admin.ivrknowledgeissue.vo.*;

/**
 * ivr-知识库问题 Mapper
 *
 * @author 数创万维
 */
@Mapper
public interface IvrKnowledgeIssueMapper extends BaseMapperX<IvrKnowledgeIssueDO> {

    default PageResult<IvrKnowledgeIssueDO> selectPage(IvrKnowledgeIssuePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IvrKnowledgeIssueDO>()
                .eqIfPresent(IvrKnowledgeIssueDO::getKnowledgeGroupId, reqVO.getKnowledgeGroupId())
                .eqIfPresent(IvrKnowledgeIssueDO::getTitle, reqVO.getTitle())
                .eqIfPresent(IvrKnowledgeIssueDO::getKnowledgeType, reqVO.getKnowledgeType())
                .likeIfPresent(IvrKnowledgeIssueDO::getLabelName, reqVO.getLabelName())
                .eqIfPresent(IvrKnowledgeIssueDO::getKeys, reqVO.getKeys())
                .eqIfPresent(IvrKnowledgeIssueDO::getAsk, reqVO.getAsk())
                .eqIfPresent(IvrKnowledgeIssueDO::getAnswerType, reqVO.getAnswerType())
                .eqIfPresent(IvrKnowledgeIssueDO::getJumpType, reqVO.getJumpType())
                .eqIfPresent(IvrKnowledgeIssueDO::getJumpIndex, reqVO.getJumpIndex())
                .eqIfPresent(IvrKnowledgeIssueDO::getIgnoreSilence, reqVO.getIgnoreSilence())
                .eqIfPresent(IvrKnowledgeIssueDO::getIsSetGrade, reqVO.getIsSetGrade())
                .eqIfPresent(IvrKnowledgeIssueDO::getIsSendSms, reqVO.getIsSendSms())
                .eqIfPresent(IvrKnowledgeIssueDO::getSmsId, reqVO.getSmsId())
                .eqIfPresent(IvrKnowledgeIssueDO::getEnableJoinBlack, reqVO.getEnableJoinBlack())
                .eqIfPresent(IvrKnowledgeIssueDO::getEnableContinuousPlay, reqVO.getEnableContinuousPlay())
                .eqIfPresent(IvrKnowledgeIssueDO::getContinuousPlayNum, reqVO.getContinuousPlayNum())
                .eqIfPresent(IvrKnowledgeIssueDO::getFlowId, reqVO.getFlowId())
                .betweenIfPresent(IvrKnowledgeIssueDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IvrKnowledgeIssueDO::getId));
    }

}